/*
 * SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
 *
 * SPDX-License-Identifier: MulanPSL-2.0
 */
#![allow(
    clippy::needless_return,
    clippy::too_many_arguments,
    clippy::eq_op,
    clippy::precedence,
    clippy::upper_case_acronyms,
    clippy::single_match,
    clippy::unnecessary_cast,
    clippy::zero_ptr,
    clippy::nonminimal_bool,
    clippy::manual_range_contains,
    clippy::unnecessary_mut_passed,
    clippy::let_and_return,
    clippy::identity_op,
    clippy::neg_multiply
)]

use crate::common::*;
extern "C" {
    fn malloc(_: libc::c_ulong) -> *mut libc::c_void;
    fn realloc(_: *mut libc::c_void, _: libc::c_ulong) -> *mut libc::c_void;
    fn free(_: *mut libc::c_void);
    fn abort() -> !;
    fn memset(_: *mut libc::c_void, _: libc::c_int, _: libc::c_ulong) -> *mut libc::c_void;
    fn strcmp(_: *const libc::c_char, _: *const libc::c_char) -> libc::c_int;
    fn strncmp(_: *const libc::c_char, _: *const libc::c_char, _: libc::c_ulong) -> libc::c_int;
    fn strlen(_: *const libc::c_char) -> libc::c_ulong;
    fn time(__timer: *mut time_t) -> time_t;
    fn gmtime(__timer: *const time_t) -> *mut tm;
    fn localtime(__timer: *const time_t) -> *mut tm;
    fn __ctype_b_loc() -> *mut *const libc::c_ushort;
    fn __ctype_tolower_loc() -> *mut *const __int32_t;
}
// 多处定义，后期统一处理
#[derive(Copy, Clone)]
#[repr(C)]
pub struct tm {
    pub tm_sec: libc::c_int,
    pub tm_min: libc::c_int,
    pub tm_hour: libc::c_int,
    pub tm_mday: libc::c_int,
    pub tm_mon: libc::c_int,
    pub tm_year: libc::c_int,
    pub tm_wday: libc::c_int,
    pub tm_yday: libc::c_int,
    pub tm_isdst: libc::c_int,
    pub tm_gmtoff: libc::c_long,
    pub tm_zone: *const libc::c_char,
}
// 多处定义，后期统一处理
pub const _ISalnum: libc::c_uint = 8;
pub const _ISpunct: libc::c_uint = 4;
pub const _IScntrl: libc::c_uint = 2;
pub const _ISblank: libc::c_uint = 1;
pub const _ISgraph: libc::c_uint = 32768;
pub const _ISprint: libc::c_uint = 16384;
pub const _ISspace: libc::c_uint = 8192;
pub const _ISxdigit: libc::c_uint = 4096;
pub const _ISdigit: libc::c_uint = 2048;
pub const _ISalpha: libc::c_uint = 1024;
pub const _ISlower: libc::c_uint = 512;
pub const _ISupper: libc::c_uint = 256;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct _TABLE {
    pub name: *mut libc::c_char,
    pub type_0: libc::c_int,
    pub value: time_t,
}
pub type TABLE = _TABLE;
pub type _DSTMODE = libc::c_uint;
pub const DSTmaybe: _DSTMODE = 2;
pub const DSToff: _DSTMODE = 1;
pub const DSTon: _DSTMODE = 0;
pub type DSTMODE = _DSTMODE;
pub const MER24: libc::c_uint = 2;
pub const MERpm: libc::c_uint = 1;
pub const MERam: libc::c_uint = 0;
pub type MERIDIAN = libc::c_uint;
#[derive(Copy, Clone)]
#[repr(C)]
pub union YYSTYPE {
    pub Number: time_t,
    pub Meridian: libc::c_uint,
}
#[inline]
unsafe extern "C" fn tolower(mut __c: libc::c_int) -> libc::c_int {
    return if __c >= -(128 as libc::c_int) && __c < 256 as libc::c_int {
        *(*__ctype_tolower_loc()).offset(__c as isize)
    } else {
        __c
    };
}
static mut yyInput: *mut libc::c_char = 0 as *const libc::c_char as *mut libc::c_char;
static mut yyDSTmode: DSTMODE = DSTon;
static mut yyDayOrdinal: time_t = 0;
static mut yyDayNumber: time_t = 0;
static mut yyHaveDate: libc::c_int = 0;
static mut yyHaveDay: libc::c_int = 0;
static mut yyHaveRel: libc::c_int = 0;
static mut yyHaveTime: libc::c_int = 0;
static mut yyHaveZone: libc::c_int = 0;
static mut yyTimezone: time_t = 0;
static mut yyDay: time_t = 0;
static mut yyHour: time_t = 0;
static mut yyMinutes: time_t = 0;
static mut yyMonth: time_t = 0;
static mut yySeconds: time_t = 0;
static mut yyYear: time_t = 0;
static mut yyMeridian: MERIDIAN = MERam;
static mut yyRelMonth: time_t = 0;
static mut yyRelSeconds: time_t = 0;
#[no_mangle]
pub static mut yylhs: [libc::c_short; 42] = [
    -1, 0, 0, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 9,
    9, 9, 9, 9, 9, 9, 9, 9, 8, 1, 1,
];
#[no_mangle]
pub static mut yylen: [libc::c_short; 42] = [
    2, 0, 2, 1, 1, 1, 1, 1, 1, 2, 4, 4, 6, 6, 1, 1, 2, 1, 2, 2, 3, 5, 3, 3, 2, 4, 2, 3, 2, 1, 2, 2,
    1, 2, 2, 1, 2, 2, 1, 1, 0, 1,
];
#[no_mangle]
pub static mut yydefred: [libc::c_short; 51] = [
    1, 0, 0, 15, 32, 0, 38, 35, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 0, 18, 0, 31, 36, 33, 19, 9, 30, 0,
    37, 34, 0, 0, 0, 16, 28, 0, 23, 27, 22, 0, 0, 25, 41, 11, 0, 10, 0, 0, 21, 13, 12,
];
#[no_mangle]
pub static mut yydgoto: [libc::c_short; 10] = [1, 45, 11, 12, 13, 14, 15, 16, 17, 18];
#[no_mangle]
pub static mut yysindex: [libc::c_short; 51] = [
    0, -249, -38, 0, 0, -260, 0, 0, -240, -47, -248, 0, 0, 0, 0, 0, 0, 0, -237, 0, -18, 0, 0, 0, 0,
    0, 0, -262, 0, 0, -239, -238, -236, 0, 0, -235, 0, 0, 0, -56, -19, 0, 0, 0, -234, 0, -232,
    -258, 0, 0, 0,
];
#[no_mangle]
pub static mut yyrindex: [libc::c_short; 51] = [
    0, 0, 1, 0, 0, 0, 0, 0, 0, 69, 12, 0, 0, 0, 0, 0, 0, 0, 23, 0, 34, 0, 0, 0, 0, 0, 0, 67, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 45, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0,
];
#[no_mangle]
pub static mut yygindex: [libc::c_short; 10] = [0, -17, 0, 0, 0, 0, 0, 0, 0, 0];
#[no_mangle]
pub static mut yytable: [libc::c_short; 338] = [
    32, 17, 44, 42, 36, 37, 19, 20, 49, 2, 3, 31, 14, 4, 5, 6, 7, 8, 9, 10, 34, 33, 21, 29, 22, 23,
    35, 38, 46, 39, 50, 40, 41, 47, 24, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 43, 24,
    0, 0, 25, 26, 27, 28, 29, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 0, 0, 17, 17, 17, 17, 17, 17, 17,
    14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 29, 29, 0, 0, 29, 29, 29, 29, 29, 29, 29, 24, 24, 0,
    0, 24, 24, 24, 24, 24, 24, 24, 20, 20, 0, 0, 20, 20, 20, 20, 20, 20, 20, 40, 40, 0, 0, 40, 40,
    40, 40, 0, 40, 40, 26, 26, 0, 39, 26, 26, 26, 26, 0, 0, 26, 39, 39,
];
#[no_mangle]
pub static mut yycheck: [libc::c_short; 338] = [
    47, 0, 58, 261, 266, 267, 44, 267, 266, 258, 259, 58, 0, 262, 263, 264, 265, 266, 267, 268,
    257, 269, 262, 0, 264, 265, 44, 266, 47, 267, 47, 267, 267, 267, 0, 267, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 261, -1, -1,
    -1, -1, 266, 258, -1, -1, 261, 262, 263, 264, 265, 266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, 258, 259, -1, -1, 262, 263, 264, 265, 266, 267, 268, 258, 259, -1, -1, 262,
    263, 264, 265, 266, 267, 268, 258, 259, -1, -1, 262, 263, 264, 265, 266, 267, 268, 258, 259,
    -1, -1, 262, 263, 264, 265, 266, 267, 268, 258, 259, -1, -1, 262, 263, 264, 265, 266, 267, 268,
    258, 259, -1, -1, 262, 263, 264, 265, -1, 267, 268, 258, 259, -1, 259, 262, 263, 264, 265, -1,
    -1, 268, 267, 268,
];

pub const tAGO: libc::c_int = 257;
pub const tDAY: libc::c_int = 258;
pub const tDAYZONE: libc::c_int = 259;
pub const tID: libc::c_int = 260;
pub const tMERIDIAN: libc::c_int = 261;
pub const tMINUTE_UNIT: libc::c_int = 262;
pub const tMONTH: libc::c_int = 263;
pub const tMONTH_UNIT: libc::c_int = 264;
pub const tSEC_UNIT: libc::c_int = 265;
pub const tSNUMBER: libc::c_int = 266;
pub const tUNUMBER: libc::c_int = 267;
pub const tZONE: libc::c_int = 268;
pub const tDST: libc::c_int = 269;
pub const YYERRCODE: libc::c_int = 256;
pub const EPOCH: libc::c_int = 1970;
// #define SECSPERDAY	(24L * 60L * 60L)
pub const SECSPERDAY: libc::c_long = 86400;

#[macro_export]
macro_rules! TABLENew {
    ($name:expr, $type:expr, $value:expr) => {
        _TABLE {
            name: $name as *const u8 as *const libc::c_char as *mut libc::c_char,
            type_0: $type as libc::c_int,
            value: $value as libc::c_int as time_t,
        }
    };
}

#[macro_export]
macro_rules! HOUR {
    ($x:expr) => {
        $x as libc::c_int as time_t * 60 as libc::c_int as libc::c_long
    };
}

/* Month and day table. */
static mut MonthDayTable: [TABLE; 25] = [
    {
        let mut init = TABLENew!(b"january\0", tMONTH, 1);
        init
    },
    {
        let mut init = TABLENew!(b"february\0", tMONTH, 2);
        init
    },
    {
        let mut init = TABLENew!(b"march\0", tMONTH, 3);
        init
    },
    {
        let mut init = TABLENew!(b"april\0", tMONTH, 4);
        init
    },
    {
        let mut init = TABLENew!(b"may\0", tMONTH, 5);
        init
    },
    {
        let mut init = TABLENew!(b"june\0", tMONTH, 6);
        init
    },
    {
        let mut init = TABLENew!(b"july\0", tMONTH, 7);
        init
    },
    {
        let mut init = TABLENew!(b"august\0", tMONTH, 8);
        init
    },
    {
        let mut init = TABLENew!(b"september\0", tMONTH, 9);
        init
    },
    {
        let mut init = TABLENew!(b"sept\0", tMONTH, 9);
        init
    },
    {
        let mut init = TABLENew!(b"october\0", tMONTH, 10);
        init
    },
    {
        let mut init = TABLENew!(b"november\0", tMONTH, 11);
        init
    },
    {
        let mut init = TABLENew!(b"december\0", tMONTH, 12);
        init
    },
    {
        let mut init = TABLENew!(b"sunday\0", tDAY, 0);
        init
    },
    {
        let mut init = TABLENew!(b"monday\0", tDAY, 1);
        init
    },
    {
        let mut init = TABLENew!(b"tuesday\0", tDAY, 2);
        init
    },
    {
        let mut init = TABLENew!(b"tues\0", tDAY, 2);
        init
    },
    {
        let mut init = TABLENew!(b"wednesday\0", tDAY, 3);
        init
    },
    {
        let mut init = TABLENew!(b"wednes\0", tDAY, 3);
        init
    },
    {
        let mut init = TABLENew!(b"thursday\0", tDAY, 4);
        init
    },
    {
        let mut init = TABLENew!(b"thur\0", tDAY, 4);
        init
    },
    {
        let mut init = TABLENew!(b"thurs\0", tDAY, 4);
        init
    },
    {
        let mut init = TABLENew!(b"friday\0", tDAY, 5);
        init
    },
    {
        let mut init = TABLENew!(b"saturday\0", tDAY, 6);
        init
    },
    {
        let mut init = TABLENew!(0, 0, 0);
        init
    },
];

/* Time units table. */
static mut UnitsTable: [TABLE; 11] = [
    {
        let mut init = TABLENew!(b"year\0", tMONTH_UNIT, 12);
        init
    },
    {
        let mut init = TABLENew!(b"month\0", tMONTH_UNIT, 1);
        init
    },
    {
        let mut init = TABLENew!(b"fortnight\0", tMINUTE_UNIT, 14 * 24 * 60);
        init
    },
    {
        let mut init = TABLENew!(b"week\0", tMINUTE_UNIT, 7 * 24 * 60);
        init
    },
    {
        let mut init = TABLENew!(b"day\0", tMINUTE_UNIT, 1 * 24 * 60);
        init
    },
    {
        let mut init = TABLENew!(b"hour\0", tMINUTE_UNIT, 60);
        init
    },
    {
        let mut init = TABLENew!(b"minute\0", tMINUTE_UNIT, 1);
        init
    },
    {
        let mut init = TABLENew!(b"min\0", tMINUTE_UNIT, 1);
        init
    },
    {
        let mut init = TABLENew!(b"second\0", tSEC_UNIT, 1);
        init
    },
    {
        let mut init = TABLENew!(b"sec\0", tSEC_UNIT, 1);
        init
    },
    {
        let mut init = TABLENew!(0, 0, 0);
        init
    },
];

/* Assorted relative-time words. */
static mut OtherTable: [TABLE; 20] = [
    {
        let mut init = TABLENew!(b"tomorrow\0", tMINUTE_UNIT, 1 * 24 * 60);
        init
    },
    {
        let mut init = TABLENew!(b"yesterday\0", tMINUTE_UNIT, -1 * 24 * 60);
        init
    },
    {
        let mut init = TABLENew!(b"today\0", tMINUTE_UNIT, 0);
        init
    },
    {
        let mut init = TABLENew!(b"now\0", tMINUTE_UNIT, 0);
        init
    },
    {
        let mut init = TABLENew!(b"last\0", tUNUMBER, -1);
        init
    },
    {
        let mut init = TABLENew!(b"this\0", tUNUMBER, 9);
        init
    },
    {
        let mut init = TABLENew!(b"next\0", tUNUMBER, 2);
        init
    },
    {
        let mut init = TABLENew!(b"first\0", tUNUMBER, 1);
        init
    },
    {
        let mut init = TABLENew!(b"third\0", tUNUMBER, 3);
        init
    },
    {
        let mut init = TABLENew!(b"fourth\0", tUNUMBER, 4);
        init
    },
    {
        let mut init = TABLENew!(b"fifth\0", tUNUMBER, 5);
        init
    },
    {
        let mut init = TABLENew!(b"sixth\0", tUNUMBER, 6);
        init
    },
    {
        let mut init = TABLENew!(b"seventh\0", tUNUMBER, 7);
        init
    },
    {
        let mut init = TABLENew!(b"eighth\0", tUNUMBER, 8);
        init
    },
    {
        let mut init = TABLENew!(b"ninth\0", tUNUMBER, 9);
        init
    },
    {
        let mut init = TABLENew!(b"tenth\0", tUNUMBER, 10);
        init
    },
    {
        let mut init = TABLENew!(b"eleventh\0", tUNUMBER, 11);
        init
    },
    {
        let mut init = TABLENew!(b"twelfth\0", tUNUMBER, 12);
        init
    },
    {
        let mut init = TABLENew!(b"ago\0", tAGO, 1);
        init
    },
    {
        let mut init = TABLENew!(0, 0, 0);
        init
    },
];
#[no_mangle]
pub static mut yydebug: libc::c_int = 0;
#[no_mangle]
pub static mut yynerrs: libc::c_int = 0;
#[no_mangle]
pub static mut yyerrflag: libc::c_int = 0;
#[no_mangle]
pub static mut yychar: libc::c_int = 0;
#[no_mangle]
pub static mut yyssp: *mut libc::c_short = 0 as *const libc::c_short as *mut libc::c_short;
#[no_mangle]
pub static mut yyvsp: *mut YYSTYPE = 0 as *const YYSTYPE as *mut YYSTYPE;
#[no_mangle]
pub static mut yyval: YYSTYPE = YYSTYPE { Number: 0 };
#[no_mangle]
pub static mut yylval: YYSTYPE = YYSTYPE { Number: 0 };
#[no_mangle]
pub static mut yyss: *mut libc::c_short = 0 as *const libc::c_short as *mut libc::c_short;
#[no_mangle]
pub static mut yysslim: *mut libc::c_short = 0 as *const libc::c_short as *mut libc::c_short;
#[no_mangle]
pub static mut yyvs: *mut YYSTYPE = 0 as *const YYSTYPE as *mut YYSTYPE;
#[no_mangle]
pub static mut yystacksize: libc::c_uint = 0;

/* The timezone table. */
/* Some of these are commented out because a time_t can't store a float. */
static mut TimezoneTable: [TABLE; 50] = [
    {
        let mut init = TABLENew!(b"gmt\0", tZONE, HOUR!(0));
        init
    },
    {
        let mut init = TABLENew!(b"ut\0", tZONE, HOUR!(0));
        init
    },
    {
        let mut init = TABLENew!(b"utc\0", tZONE, HOUR!(0));
        init
    },
    {
        let mut init = TABLENew!(b"wet\0", tZONE, HOUR!(0));
        init
    },
    {
        let mut init = TABLENew!(b"bst\0", tDAYZONE, HOUR!(0));
        init
    },
    {
        let mut init = TABLENew!(b"wat\0", tZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"at\0", tZONE, HOUR!(2));
        init
    },
    {
        let mut init = TABLENew!(b"ast\0", tZONE, HOUR!(4));
        init
    },
    {
        let mut init = TABLENew!(b"adt\0", tDAYZONE, HOUR!(4));
        init
    },
    {
        let mut init = TABLENew!(b"est\0", tZONE, HOUR!(5));
        init
    },
    {
        let mut init = TABLENew!(b"edt\0", tDAYZONE, HOUR!(5));
        init
    },
    {
        let mut init = TABLENew!(b"cst\0", tZONE, HOUR!(6));
        init
    },
    {
        let mut init = TABLENew!(b"cdt\0", tDAYZONE, HOUR!(6));
        init
    },
    {
        let mut init = TABLENew!(b"mst\0", tZONE, HOUR!(7));
        init
    },
    {
        let mut init = TABLENew!(b"mdt\0", tDAYZONE, HOUR!(7));
        init
    },
    {
        let mut init = TABLENew!(b"pst\0", tZONE, HOUR!(8));
        init
    },
    {
        let mut init = TABLENew!(b"pdt\0", tDAYZONE, HOUR!(8));
        init
    },
    {
        let mut init = TABLENew!(b"yst\0", tZONE, HOUR!(9));
        init
    },
    {
        let mut init = TABLENew!(b"ydt\0", tDAYZONE, HOUR!(9));
        init
    },
    {
        let mut init = TABLENew!(b"hst\0", tZONE, HOUR!(10));
        init
    },
    {
        let mut init = TABLENew!(b"hdt\0", tDAYZONE, HOUR!(10));
        init
    },
    {
        let mut init = TABLENew!(b"cat\0", tZONE, HOUR!(10));
        init
    },
    {
        let mut init = TABLENew!(b"ahst\0", tZONE, HOUR!(10));
        init
    },
    {
        let mut init = TABLENew!(b"nt\0", tZONE, HOUR!(11));
        init
    },
    {
        let mut init = TABLENew!(b"idlw\0", tZONE, HOUR!(12));
        init
    },
    {
        let mut init = TABLENew!(b"cet\0", tZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"met\0", tZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"mewt\0", tZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"mest\0", tDAYZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"swt\0", tZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"sst\0", tDAYZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"fwt\0", tZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"fst\0", tDAYZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"eet\0", tZONE, HOUR!(2));
        init
    },
    {
        let mut init = TABLENew!(b"bt\0", tZONE, HOUR!(3));
        init
    },
    {
        let mut init = TABLENew!(b"zp4\0", tZONE, HOUR!(4));
        init
    },
    {
        let mut init = TABLENew!(b"zp5\0", tZONE, HOUR!(5));
        init
    },
    {
        let mut init = TABLENew!(b"zp6\0", tZONE, HOUR!(6));
        init
    },
    {
        let mut init = TABLENew!(b"wast\0", tZONE, HOUR!(7));
        init
    },
    {
        let mut init = TABLENew!(b"wadt\0", tDAYZONE, HOUR!(7));
        init
    },
    {
        let mut init = TABLENew!(b"cct\0", tZONE, HOUR!(8));
        init
    },
    {
        let mut init = TABLENew!(b"jst\0", tZONE, HOUR!(9));
        init
    },
    {
        let mut init = TABLENew!(b"east\0", tZONE, HOUR!(10));
        init
    },
    {
        let mut init = TABLENew!(b"eadt\0", tDAYZONE, HOUR!(10));
        init
    },
    {
        let mut init = TABLENew!(b"gst\0", tZONE, HOUR!(10));
        init
    },
    {
        let mut init = TABLENew!(b"nzt\0", tZONE, HOUR!(12));
        init
    },
    {
        let mut init = TABLENew!(b"nzst\0", tZONE, HOUR!(12));
        init
    },
    {
        let mut init = TABLENew!(b"nzdt\0", tDAYZONE, HOUR!(12));
        init
    },
    {
        let mut init = TABLENew!(b"idle\0", tZONE, HOUR!(12));
        init
    },
    {
        let mut init = TABLENew!(0, 0, 0);
        init
    },
];

/* Military timezone table. */
static mut MilitaryTable: [TABLE; 26] = [
    {
        let mut init = TABLENew!(b"a\0", tZONE, HOUR!(1));
        init
    },
    {
        let mut init = TABLENew!(b"b\0", tZONE, HOUR!(2));
        init
    },
    {
        let mut init = TABLENew!(b"c\0", tZONE, HOUR!(3));
        init
    },
    {
        let mut init = TABLENew!(b"d\0", tZONE, HOUR!(4));
        init
    },
    {
        let mut init = TABLENew!(b"e\0", tZONE, HOUR!(5));
        init
    },
    {
        let mut init = TABLENew!(b"f\0", tZONE, HOUR!(6));
        init
    },
    {
        let mut init = TABLENew!(b"g\0", tZONE, HOUR!(7));
        init
    },
    {
        let mut init = TABLENew!(b"h\0", tZONE, HOUR!(8));
        init
    },
    {
        let mut init = TABLENew!(b"i\0", tZONE, HOUR!(8));
        init
    },
    {
        let mut init = TABLENew!(b"k\0", tZONE, HOUR!(10));
        init
    },
    {
        let mut init = TABLENew!(b"l\0", tZONE, HOUR!(11));
        init
    },
    {
        let mut init = TABLENew!(b"m\0", tZONE, HOUR!(12));
        init
    },
    {
        let mut init = TABLENew!(b"n\0", tZONE, HOUR!(-1));
        init
    },
    {
        let mut init = TABLENew!(b"o\0", tZONE, HOUR!(-2));
        init
    },
    {
        let mut init = TABLENew!(b"p\0", tZONE, HOUR!(-3));
        init
    },
    {
        let mut init = TABLENew!(b"q\0", tZONE, HOUR!(-4));
        init
    },
    {
        let mut init = TABLENew!(b"r\0", tZONE, HOUR!(-5));
        init
    },
    {
        let mut init = TABLENew!(b"s\0", tZONE, HOUR!(-6));
        init
    },
    {
        let mut init = TABLENew!(b"t\0", tZONE, HOUR!(-7));
        init
    },
    {
        let mut init = TABLENew!(b"u\0", tZONE, HOUR!(-8));
        init
    },
    {
        let mut init = TABLENew!(b"v\0", tZONE, HOUR!(-9));
        init
    },
    {
        let mut init = TABLENew!(b"w\0", tZONE, HOUR!(-10));
        init
    },
    {
        let mut init = TABLENew!(b"x\0", tZONE, HOUR!(-11));
        init
    },
    {
        let mut init = TABLENew!(b"y\0", tZONE, HOUR!(-12));
        init
    },
    {
        let mut init = TABLENew!(b"z\0", tZONE, HOUR!(0));
        init
    },
    {
        let mut init = TABLENew!(0, 0, 0);
        init
    },
];
/* ARGSUSED */
fn yyerror(mut s: *const libc::c_char) -> libc::c_int {
    return 0 as libc::c_int;
}
fn ToSeconds(
    mut Hours: time_t,
    mut Minutes: time_t,
    mut Seconds: time_t,
    mut Meridian: MERIDIAN,
) -> time_t {
    if Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59 {
        return -(1 as libc::c_int) as time_t;
    }
    unsafe {
        match Meridian as libc::c_uint {
            MER24 => {
                if Hours < 0 || Hours > 23 {
                    return -(1 as libc::c_int) as time_t;
                }
                return (Hours * 60 + Minutes) * 60 + Seconds;
            }
            MERam => {
                if Hours < 1 || Hours > 12 {
                    return -(1 as libc::c_int) as time_t;
                }
                if Hours == 12 {
                    Hours = 0;
                }
                return (Hours * 60 + Minutes) * 60 + Seconds;
            }
            MERpm => {
                if Hours < 1 || Hours > 12 {
                    return -(1 as libc::c_int) as time_t;
                }
                if Hours == 12 {
                    Hours = 0;
                }
                return ((Hours + 12) * 60 + Minutes) * 60 + Seconds;
            }
            _ => {
                abort();
            }
        };
    } //unsafe /* NOTREACHED */
}

/* Year is either
 * A negative number, which means to use its absolute value (why?)
 * A number from 0 to 99, which means a year from 1900 to 1999, or
 * The actual year (>=100).  */
fn Convert(
    mut Month: time_t,
    mut Day: time_t,
    mut Year: time_t,
    mut Hours: time_t,
    mut Minutes: time_t,
    mut Seconds: time_t,
    mut Meridian: MERIDIAN,
    mut DSTmode: DSTMODE,
) -> time_t {
    static mut DaysInMonth: [libc::c_int; 12] = [31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    let mut tm: *mut tm = 0 as *mut tm;
    let mut tod: time_t = 0;
    let mut Julian: time_t = 0;
    let mut i: libc::c_int = 0;
    if Year < 0 {
        Year = -Year;
    }
    if Year < 69 {
        Year += 2000;
    } else if Year < 100 {
        Year += 1900;
        if Year < EPOCH as libc::c_long {
            Year += 100;
        }
    }
    unsafe {
        DaysInMonth[1 as libc::c_int as usize] =
            if Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) {
                29
            } else {
                28
            };
        /* 32-bit time_t cannot represent years past 2038 */
        if Year < EPOCH  as libc::c_long
        || ::core::mem::size_of::<time_t>() as libc::c_ulong
            == ::core::mem::size_of::<libc::c_int>() as libc::c_ulong
            && Year > 2038
        || Month < 1
        || Month > 12
        /* Lint fluff:  "conversion from long may lose accuracy" */
        || Day < 1
        || {
            Month -= 1;
            Day > DaysInMonth[Month as libc::c_int as usize] as libc::c_long
        } {
            return -(1 as libc::c_int) as time_t;
        }
        Julian = Day - 1;
        i = 0 as libc::c_int;
        while (i as libc::c_long) < Month {
            Julian += DaysInMonth[i as usize] as libc::c_long;
            i += 1;
        }
        i = EPOCH as libc::c_int;
        while (i as libc::c_long) < Year {
            Julian += (365 as libc::c_int
                + (i % 4 as libc::c_int == 0 as libc::c_int) as libc::c_int)
                as libc::c_long;
            i += 1;
        }
        Julian *= SECSPERDAY;
        Julian += yyTimezone * 60 as libc::c_long;
        tod = ToSeconds(Hours, Minutes, Seconds, Meridian);
        if tod < 0 {
            return -(1 as libc::c_int) as time_t;
        }
        Julian += tod;
        if DSTmode as libc::c_uint == DSTon as libc::c_int as libc::c_uint
            || DSTmode as libc::c_uint == DSTmaybe as libc::c_int as libc::c_uint
                && {
                    tm = localtime(&mut Julian);
                    !tm.is_null()
                }
                && (*tm).tm_isdst != 0
        {
            Julian -= (60 * 60) as libc::c_long;
        }
        return Julian;
    } //unsafe
}

fn DSTcorrect(mut Start: time_t, mut Future: time_t) -> time_t {
    let mut start_tm: *mut tm = 0 as *mut tm;
    let mut future_tm: *mut tm = 0 as *mut tm;
    let mut StartDay: time_t = 0;
    let mut FutureDay: time_t = 0;
    unsafe {
        start_tm = localtime(&mut Start);
        future_tm = localtime(&mut Future);
        if start_tm.is_null() || future_tm.is_null() {
            return -(1 as libc::c_int) as time_t;
        }
        StartDay = (((*start_tm).tm_hour + 1) % 24) as time_t;
        FutureDay = (((*future_tm).tm_hour + 1) % 24) as time_t;
        return Future - Start + (StartDay - FutureDay) * 60 as libc::c_long * 60 as libc::c_long;
    } //unsafe
}
fn RelativeDate(mut Start: time_t, mut DayOrdinal: time_t, mut DayNumber: time_t) -> time_t {
    let mut tm: *mut tm = 0 as *mut tm;
    let mut now: time_t = 0;
    now = Start;
    unsafe {
        tm = localtime(&mut now);
        if tm.is_null() {
            return -(1 as libc::c_int) as time_t;
        }
        now += SECSPERDAY
            * ((DayNumber - (*tm).tm_wday as libc::c_int as libc::c_long
                + 7 as libc::c_int as libc::c_long)
                % 7) as libc::c_int as libc::c_long;
        now += 7
            * (SECSPERDAY)
            * (if DayOrdinal <= 0 as libc::c_int as libc::c_long {
                DayOrdinal
            } else {
                DayOrdinal - 1 as libc::c_int as libc::c_long
            });
        return DSTcorrect(Start, now);
    } //unsafe
}
fn RelativeMonth(mut Start: time_t, mut RelMonth: time_t) -> time_t {
    let mut tm: *mut tm = 0 as *mut tm;
    let mut Month: time_t = 0;
    let mut Year: time_t = 0;
    if RelMonth == 0 as libc::c_int as libc::c_long {
        return 0 as libc::c_int as time_t;
    }
    unsafe {
        tm = localtime(&mut Start);
        if tm.is_null() {
            return -(1 as libc::c_int) as time_t;
        }
        Month = (12 as libc::c_int * ((*tm).tm_year + 1900 as libc::c_int) + (*tm).tm_mon)
            as libc::c_long
            + RelMonth;
        Year = Month / 12 as libc::c_int as libc::c_long;
        Month = Month % 12 as libc::c_int as libc::c_long + 1 as libc::c_int as libc::c_long;
        return DSTcorrect(
            Start,
            Convert(
                Month,
                (*tm).tm_mday as time_t,
                Year,
                (*tm).tm_hour as time_t,
                (*tm).tm_min as time_t,
                (*tm).tm_sec as time_t,
                MER24,
                DSTmaybe,
            ),
        );
    } //unsafe
}
fn LookupWord(mut buff: *mut libc::c_char) -> libc::c_int {
    let mut p: *mut libc::c_char = 0 as *mut libc::c_char;
    let mut q: *mut libc::c_char = 0 as *mut libc::c_char;
    let mut tp: *const TABLE = 0 as *const TABLE;
    let mut i: libc::c_int = 0;
    let mut abbrev: libc::c_int = 0;
    p = buff;

    /* Make it lowercase. */
    unsafe {
        while *p != 0 {
            if *(*__ctype_b_loc()).offset(*p as libc::c_uchar as libc::c_int as isize)
                as libc::c_int
                & _ISupper as libc::c_int as libc::c_ushort as libc::c_int
                != 0
            {
                *p = ({
                    let mut __res: libc::c_int = 0;
                    if ::core::mem::size_of::<libc::c_uchar>() as libc::c_ulong
                        > 1 as libc::c_int as libc::c_ulong
                    {
                        if 0 != 0 {
                            let mut __c: libc::c_int = *p as libc::c_uchar as libc::c_int;
                            __res = if __c < -(128 as libc::c_int) || __c > 255 as libc::c_int {
                                __c
                            } else {
                                *(*__ctype_tolower_loc()).offset(__c as isize)
                            };
                        } else {
                            __res = tolower(*p as libc::c_uchar as libc::c_int);
                        }
                    } else {
                        __res = *(*__ctype_tolower_loc())
                            .offset(*p as libc::c_uchar as libc::c_int as isize);
                    }
                    __res
                }) as libc::c_char;
            }
            p = p.offset(1);
        }

        if strcmp(buff, b"am\0" as *const u8 as *const libc::c_char) == 0
            || strcmp(buff, b"a.m.\0" as *const u8 as *const libc::c_char) == 0
        {
            yylval.Meridian = MERam;
            return tMERIDIAN;
        }
        if strcmp(buff, b"pm\0" as *const u8 as *const libc::c_char) == 0
            || strcmp(buff, b"p.m.\0" as *const u8 as *const libc::c_char) == 0
        {
            yylval.Meridian = MERpm;
            return tMERIDIAN;
        }

        /* See if we have an abbreviation for a month. */
        if strlen(buff) == 3 {
            abbrev = 1;
        } else if strlen(buff) == 4 && *buff.offset(3 as isize) as libc::c_int == '.' as i32 {
            abbrev = 1;
            *buff.offset(3 as isize) = '\0' as i32 as libc::c_char;
        } else {
            abbrev = 0;
        }

        tp = MonthDayTable.as_ptr();
        while !((*tp).name).is_null() {
            if abbrev != 0 {
                if strncmp(buff, (*tp).name, 3 as libc::c_ulong) == 0 {
                    yylval.Number = (*tp).value;
                    return (*tp).type_0;
                }
            } else if strcmp(buff, (*tp).name) == 0 {
                yylval.Number = (*tp).value;
                return (*tp).type_0;
            }
            tp = tp.offset(1);
        }
        tp = TimezoneTable.as_ptr();
        while !((*tp).name).is_null() {
            if strcmp(buff, (*tp).name) == 0 {
                yylval.Number = (*tp).value;
                return (*tp).type_0;
            }
            tp = tp.offset(1);
        }
        if strcmp(buff, b"dst\0" as *const u8 as *const libc::c_char) == 0 {
            return tDST;
        }
        tp = UnitsTable.as_ptr();
        while !((*tp).name).is_null() {
            if strcmp(buff, (*tp).name) == 0 {
                yylval.Number = (*tp).value;
                return (*tp).type_0;
            }
            tp = tp.offset(1);
        }
        /* Strip off any plural and try the units table again. */
        i = (strlen(buff)).wrapping_sub(1 as libc::c_ulong) as libc::c_int;
        if *buff.offset(i as isize) as libc::c_int == 's' as i32 {
            *buff.offset(i as isize) = '\0' as i32 as libc::c_char;
            tp = UnitsTable.as_ptr();
            while !((*tp).name).is_null() {
                if strcmp(buff, (*tp).name) == 0 as libc::c_int {
                    yylval.Number = (*tp).value;
                    return (*tp).type_0;
                }
                tp = tp.offset(1);
            }
            *buff.offset(i as isize) = 's' as i32 as libc::c_char; /* Put back for "this" in OtherTable. */
        }
        tp = OtherTable.as_ptr();
        while !((*tp).name).is_null() {
            if strcmp(buff, (*tp).name) == 0 as libc::c_int {
                yylval.Number = (*tp).value;
                return (*tp).type_0;
            }
            tp = tp.offset(1);
        }

        /* Military timezones. */
        if *buff.offset(1 as libc::c_int as isize) as libc::c_int == '\0' as i32
            && *(*__ctype_b_loc()).offset(*buff as libc::c_uchar as libc::c_int as isize)
                as libc::c_int
                & _ISalpha as libc::c_int as libc::c_ushort as libc::c_int
                != 0
        {
            tp = MilitaryTable.as_ptr();
            while !((*tp).name).is_null() {
                if strcmp(buff, (*tp).name) == 0 as libc::c_int {
                    yylval.Number = (*tp).value;
                    return (*tp).type_0;
                }
                tp = tp.offset(1);
            }
        }

        /* Drop out any periods and try the timezone table again. */
        i = 0 as libc::c_int;
        q = buff;
        p = q;
        while *q != 0 {
            if *q as libc::c_int != '.' as i32 {
                let fresh0 = p;
                p = p.offset(1);
                *fresh0 = *q;
            } else {
                i += 1;
            }
            q = q.offset(1);
        }
        *p = '\0' as i32 as libc::c_char;
        if i != 0 {
            tp = TimezoneTable.as_ptr();
            while !((*tp).name).is_null() {
                if strcmp(buff, (*tp).name) == 0 as libc::c_int {
                    yylval.Number = (*tp).value;
                    return (*tp).type_0;
                }
                tp = tp.offset(1);
            }
        }
        return tID;
    } //unsafe
}
fn yylex() -> libc::c_int {
    let mut c: libc::c_char = 0;
    let mut p: *mut libc::c_char = 0 as *mut libc::c_char;
    let mut buff: [libc::c_char; 20] = [0; 20];
    let mut Count: libc::c_int = 0;
    let mut sign: libc::c_int = 0;
    unsafe {
        loop {
            while *(*__ctype_b_loc()).offset(*yyInput as libc::c_uchar as libc::c_int as isize)
                as libc::c_int
                & _ISspace as libc::c_int as libc::c_ushort as libc::c_int
                != 0
            {
                yyInput = yyInput.offset(1);
            }
            c = *yyInput;
            if *(*__ctype_b_loc()).offset(c as libc::c_uchar as libc::c_int as isize) as libc::c_int
                & _ISdigit as libc::c_int as libc::c_ushort as libc::c_int
                != 0
                || c as libc::c_int == '-' as i32
                || c as libc::c_int == '+' as i32
            {
                if c as libc::c_int == '-' as i32 || c as libc::c_int == '+' as i32 {
                    sign = if c as libc::c_int == '-' as i32 {
                        -(1 as libc::c_int)
                    } else {
                        1 as libc::c_int
                    };
                    yyInput = yyInput.offset(1);
                    if *(*__ctype_b_loc()).offset(*yyInput as libc::c_uchar as libc::c_int as isize)
                        as libc::c_int
                        & _ISdigit as libc::c_int as libc::c_ushort as libc::c_int
                        == 0
                    {
                        continue;
                    }
                } else {
                    sign = 0 as libc::c_int;
                }
                yylval.Number = 0 as libc::c_int as time_t;
                loop {
                    let fresh1 = yyInput;
                    yyInput = yyInput.offset(1);
                    c = *fresh1;
                    if !(*(*__ctype_b_loc()).offset(c as libc::c_uchar as libc::c_int as isize)
                        as libc::c_int
                        & _ISdigit as libc::c_int as libc::c_ushort as libc::c_int
                        != 0)
                    {
                        break;
                    }
                    yylval.Number = 10 as libc::c_int as libc::c_long * yylval.Number
                        + c as libc::c_long
                        - '0' as i32 as libc::c_long;
                }
                yyInput = yyInput.offset(-1);
                if sign < 0 as libc::c_int {
                    yylval.Number = -yylval.Number;
                }
                return if sign != 0 {
                    266 as libc::c_int
                } else {
                    267 as libc::c_int
                };
            } else {
                if *(*__ctype_b_loc()).offset(c as libc::c_uchar as libc::c_int as isize)
                    as libc::c_int
                    & _ISalpha as libc::c_int as libc::c_ushort as libc::c_int
                    != 0
                {
                    p = buff.as_mut_ptr();
                    loop {
                        let fresh2 = yyInput;
                        yyInput = yyInput.offset(1);
                        c = *fresh2;
                        if !(*(*__ctype_b_loc()).offset(c as libc::c_uchar as libc::c_int as isize)
                            as libc::c_int
                            & _ISalpha as libc::c_int as libc::c_ushort as libc::c_int
                            != 0
                            || c as libc::c_int == '.' as i32)
                        {
                            break;
                        }
                        if p < &mut *buff.as_mut_ptr().offset(
                            (::core::mem::size_of::<[libc::c_char; 20]>() as libc::c_ulong)
                                .wrapping_sub(1 as libc::c_int as libc::c_ulong)
                                as isize,
                        ) as *mut libc::c_char
                        {
                            let fresh3 = p;
                            p = p.offset(1);
                            *fresh3 = c;
                        }
                    }
                    *p = '\0' as i32 as libc::c_char;
                    yyInput = yyInput.offset(-1);
                    return LookupWord(buff.as_mut_ptr());
                }
                if c as libc::c_int != '(' as i32 {
                    let fresh4 = yyInput;
                    yyInput = yyInput.offset(1);
                    return *fresh4 as libc::c_int;
                }
                Count = 0 as libc::c_int;
                loop {
                    let fresh5 = yyInput;
                    yyInput = yyInput.offset(1);
                    c = *fresh5;
                    if c as libc::c_int == '\0' as i32 {
                        return c as libc::c_int;
                    }
                    if c as libc::c_int == '(' as i32 {
                        Count += 1;
                    } else if c as libc::c_int == ')' as i32 {
                        Count -= 1;
                    }
                    if !(Count > 0 as libc::c_int) {
                        break;
                    }
                }
            }
        }
    } //unsafe
}

/* Yield A - B, measured in seconds.  */
fn difftm(mut a: *mut tm, mut b: *mut tm) -> libc::c_long {
    unsafe {
        let mut ay: libc::c_int = (*a).tm_year + (1900 as libc::c_int - 1 as libc::c_int);
        let mut by: libc::c_int = (*b).tm_year + (1900 as libc::c_int - 1 as libc::c_int);
        /* difference in day of year */
        let mut days: libc::c_int =
            (((*a).tm_yday - (*b).tm_yday + ((ay >> 2 as libc::c_int) - (by >> 2 as libc::c_int))
                - (ay / 100 as libc::c_int - by / 100 as libc::c_int)
                + ((ay / 100 as libc::c_int >> 2 as libc::c_int)
                    - (by / 100 as libc::c_int >> 2 as libc::c_int))) as libc::c_long
                + (ay - by) as libc::c_long * 365 as libc::c_int as libc::c_long)
                as libc::c_int;
        return (60 as libc::c_int
            * (60 as libc::c_int * (24 as libc::c_int * days + ((*a).tm_hour - (*b).tm_hour))
                + ((*a).tm_min - (*b).tm_min))
            + ((*a).tm_sec - (*b).tm_sec)) as libc::c_long;
    } //unsafe
}

#[no_mangle]
pub fn get_date(mut p: *mut libc::c_char) -> time_t {
    let mut tm: *mut tm = 0 as *mut tm;
    let mut gmt: *mut tm = 0 as *mut tm;
    let mut gmtbuf: tm = tm {
        tm_sec: 0,
        tm_min: 0,
        tm_hour: 0,
        tm_mday: 0,
        tm_mon: 0,
        tm_year: 0,
        tm_wday: 0,
        tm_yday: 0,
        tm_isdst: 0,
        tm_gmtoff: 0,
        tm_zone: 0 as *const libc::c_char,
    };
    let mut Start: time_t = 0;
    let mut tod: time_t = 0;
    let mut now: time_t = 0;
    let mut timezone: time_t = 0;
    unsafe {
        yyInput = p;
        time(&mut now);
        gmt = gmtime(&mut now);
        if !gmt.is_null() {
            /* Make a copy, in case localtime modifies *tm (I think
            that comment now applies to *gmt, but I am too
            lazy to dig into how gmtime and locatime allocate the
            structures they return pointers to).  */
            gmtbuf = *gmt;
            gmt = &mut gmtbuf;
        }
        tm = localtime(&mut now);
        if tm.is_null() {
            return -(1 as libc::c_int) as time_t;
        }
        if !gmt.is_null() {
            timezone = difftm(gmt, tm) / 60 as libc::c_int as libc::c_long;
        } else {
            /* We are on a system like VMS, where the system clock is
            in local time and the system has no concept of timezones.
            Hopefully we can fake this out (for the case in which the
            user specifies no timezone) by just saying the timezone
            is zero.  */
            timezone = 0 as libc::c_int as time_t;
        }
        if (*tm).tm_isdst != 0 {
            timezone += 60 as libc::c_int as libc::c_long;
        }
        yyYear = ((*tm).tm_year + 1900 as libc::c_int) as time_t;
        yyMonth = ((*tm).tm_mon + 1 as libc::c_int) as time_t;
        yyDay = (*tm).tm_mday as time_t;
        yyTimezone = timezone;
        yyDSTmode = DSTmaybe;
        yyHour = 0 as libc::c_int as time_t;
        yyMinutes = 0 as libc::c_int as time_t;
        yySeconds = 0 as libc::c_int as time_t;
        yyMeridian = MER24;
        yyRelSeconds = 0 as libc::c_int as time_t;
        yyRelMonth = 0 as libc::c_int as time_t;
        yyHaveDate = 0 as libc::c_int;
        yyHaveDay = 0 as libc::c_int;
        yyHaveRel = 0 as libc::c_int;
        yyHaveTime = 0 as libc::c_int;
        yyHaveZone = 0 as libc::c_int;
        if yyparse() != 0
            || yyHaveTime > 1 as libc::c_int
            || yyHaveZone > 1 as libc::c_int
            || yyHaveDate > 1 as libc::c_int
            || yyHaveDay > 1 as libc::c_int
        {
            return -(1 as libc::c_int) as time_t;
        }
        if yyHaveDate != 0 || yyHaveTime != 0 || yyHaveDay != 0 {
            Start = Convert(
                yyMonth, yyDay, yyYear, yyHour, yyMinutes, yySeconds, yyMeridian, yyDSTmode,
            );
            if Start < 0 as libc::c_int as libc::c_long {
                return -(1 as libc::c_int) as time_t;
            }
        } else {
            Start = now;
            if yyHaveRel == 0 {
                Start -= ((*tm).tm_hour as libc::c_long * 60 as libc::c_long
                    + (*tm).tm_min as libc::c_long)
                    * 60 as libc::c_long
                    + (*tm).tm_sec as libc::c_long;
            }
        }
        Start += yyRelSeconds;
        Start += RelativeMonth(Start, yyRelMonth);
        if yyHaveDay != 0 && yyHaveDate == 0 {
            tod = RelativeDate(Start, yyDayOrdinal, yyDayNumber);
            Start += tod;
        }

        /* Have to do *something* with a legitimate -1 so it's distinguishable
         * from the error return value.  (Alternately could set errno on error.) */
        return if Start == -(1 as libc::c_int) as libc::c_long {
            0 as libc::c_int as libc::c_long
        } else {
            Start
        };
    } //unsafe
}
fn yygrowstack() -> libc::c_int {
    let mut newsize: libc::c_uint = 0;
    let mut sslen: libc::c_long = 0;
    let mut newss: *mut libc::c_short = 0 as *mut libc::c_short;
    let mut newvs: *mut YYSTYPE = 0 as *mut YYSTYPE;
    unsafe {
        newsize = yystacksize;
        if newsize == 0 as libc::c_int as libc::c_uint {
            newsize = 200 as libc::c_int as libc::c_uint;
        } else if newsize >= 10000 as libc::c_int as libc::c_uint {
            return -(1 as libc::c_int);
        } else {
            newsize = newsize.wrapping_mul(2 as libc::c_int as libc::c_uint);
            if newsize > 10000 as libc::c_int as libc::c_uint {
                newsize = 10000 as libc::c_int as libc::c_uint;
            }
        }
        if !((18446744073709551615 as libc::c_ulong).wrapping_div(newsize as libc::c_ulong)
            < ::core::mem::size_of::<libc::c_short>() as libc::c_ulong)
        {
            sslen = yyssp.offset_from(yyss) as libc::c_long;
            newss = if !yyss.is_null() {
                realloc(
                    yyss as *mut libc::c_void,
                    (newsize as libc::c_ulong)
                        .wrapping_mul(::core::mem::size_of::<libc::c_short>() as libc::c_ulong),
                ) as *mut libc::c_short
            } else {
                malloc(
                    (newsize as libc::c_ulong)
                        .wrapping_mul(::core::mem::size_of::<libc::c_short>() as libc::c_ulong),
                ) as *mut libc::c_short
            };
            if !newss.is_null() {
                yyss = newss;
                yyssp = newss.offset(sslen as isize);
                newvs = if !yyvs.is_null() {
                    realloc(
                        yyvs as *mut libc::c_void,
                        (newsize as libc::c_ulong)
                            .wrapping_mul(::core::mem::size_of::<YYSTYPE>() as libc::c_ulong),
                    ) as *mut YYSTYPE
                } else {
                    malloc(
                        (newsize as libc::c_ulong)
                            .wrapping_mul(::core::mem::size_of::<YYSTYPE>() as libc::c_ulong),
                    ) as *mut YYSTYPE
                };
                if !newvs.is_null() {
                    yyvs = newvs;
                    yyvsp = newvs.offset(sslen as isize);
                    yystacksize = newsize;
                    yysslim = yyss
                        .offset(newsize as isize)
                        .offset(-(1 as libc::c_int as isize));
                    return 0 as libc::c_int;
                }
            }
        }
        if !yyss.is_null() {
            free(yyss as *mut libc::c_void);
        }
        if !yyvs.is_null() {
            free(yyvs as *mut libc::c_void);
        }
        yyssp = 0 as *mut libc::c_short;
        yyss = yyssp;
        yyvsp = 0 as *mut YYSTYPE;
        yyvs = yyvsp;
        yystacksize = 0 as libc::c_int as libc::c_uint;
    } //unsafe
    return -(1 as libc::c_int);
}
#[no_mangle]
pub fn yyparse() -> libc::c_int {
    let mut current_block: u64;
    let mut yym: libc::c_int = 0;
    let mut yyn: libc::c_int = 0;
    let mut yystate: libc::c_int = 0;
    unsafe {
        yynerrs = 0 as libc::c_int;
        yyerrflag = 0 as libc::c_int;
        yychar = -(1 as libc::c_int);
        if yyss.is_null() && yygrowstack() != 0 {
            current_block = 5448092431880210809;
        } else {
            yyssp = yyss;
            yyvsp = yyvs;
            yystate = 0 as libc::c_int;
            *yyssp = yystate as libc::c_short;
            '_yyloop: loop {
                yyn = yydefred[yystate as usize] as libc::c_int;
                if !(yyn != 0 as libc::c_int) {
                    if yychar < 0 as libc::c_int {
                        yychar = yylex();
                        if yychar < 0 as libc::c_int {
                            yychar = 0 as libc::c_int;
                        }
                    }
                    yyn = yysindex[yystate as usize] as libc::c_int;
                    if yyn != 0
                        && {
                            yyn += yychar;
                            yyn >= 0 as libc::c_int
                        }
                        && yyn <= 337 as libc::c_int
                        && yycheck[yyn as usize] as libc::c_int == yychar
                    {
                        if yyssp >= yysslim && yygrowstack() != 0 {
                            current_block = 5448092431880210809;
                            break;
                        }
                        yystate = yytable[yyn as usize] as libc::c_int;
                        yyssp = yyssp.offset(1);
                        *yyssp = yystate as libc::c_short;
                        yyvsp = yyvsp.offset(1);
                        *yyvsp = yylval;
                        yychar = -(1 as libc::c_int);
                        if yyerrflag > 0 as libc::c_int {
                            yyerrflag -= 1;
                        }
                        continue;
                    } else {
                        yyn = yyrindex[yystate as usize] as libc::c_int;
                        if yyn != 0
                            && {
                                yyn += yychar;
                                yyn >= 0 as libc::c_int
                            }
                            && yyn <= 337 as libc::c_int
                            && yycheck[yyn as usize] as libc::c_int == yychar
                        {
                            yyn = yytable[yyn as usize] as libc::c_int;
                        } else {
                            if !(yyerrflag != 0) {
                                yyerror(b"syntax error\0" as *const u8 as *const libc::c_char);
                                yynerrs += 1;
                            }
                            if yyerrflag < 3 as libc::c_int {
                                yyerrflag = 3 as libc::c_int;
                                loop {
                                    yyn = yysindex[*yyssp as usize] as libc::c_int;
                                    if yyn != 0
                                        && {
                                            yyn += 256 as libc::c_int;
                                            yyn >= 0 as libc::c_int
                                        }
                                        && yyn <= 337 as libc::c_int
                                        && yycheck[yyn as usize] as libc::c_int
                                            == 256 as libc::c_int
                                    {
                                        if yyssp >= yysslim && yygrowstack() != 0 {
                                            current_block = 5448092431880210809;
                                            break '_yyloop;
                                        }
                                        yystate = yytable[yyn as usize] as libc::c_int;
                                        yyssp = yyssp.offset(1);
                                        *yyssp = yystate as libc::c_short;
                                        yyvsp = yyvsp.offset(1);
                                        *yyvsp = yylval;
                                        continue '_yyloop;
                                    } else {
                                        if yyssp <= yyss {
                                            current_block = 14849255860313904483;
                                            break '_yyloop;
                                        }
                                        yyssp = yyssp.offset(-1);
                                        yyvsp = yyvsp.offset(-1);
                                    }
                                }
                            } else {
                                if yychar == 0 as libc::c_int {
                                    current_block = 14849255860313904483;
                                    break;
                                }
                                yychar = -(1 as libc::c_int);
                                continue;
                            }
                        }
                    }
                }
                yym = yylen[yyn as usize] as libc::c_int;
                if yym != 0 {
                    yyval = *yyvsp.offset((1 as libc::c_int - yym) as isize);
                } else {
                    memset(
                        &mut yyval as *mut YYSTYPE as *mut libc::c_void,
                        0 as libc::c_int,
                        ::core::mem::size_of::<YYSTYPE>() as libc::c_ulong,
                    );
                }
                match yyn {
                    3 => {
                        yyHaveTime += 1;
                    }
                    4 => {
                        yyHaveZone += 1;
                    }
                    5 => {
                        yyHaveDate += 1;
                    }
                    6 => {
                        yyHaveDay += 1;
                    }
                    7 => {
                        yyHaveRel += 1;
                    }
                    9 => {
                        yyHour = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyMinutes = 0 as libc::c_int as time_t;
                        yySeconds = 0 as libc::c_int as time_t;
                        yyMeridian = (*yyvsp.offset(0 as libc::c_int as isize)).Meridian;
                    }
                    10 => {
                        yyHour = (*yyvsp.offset(-(3 as libc::c_int) as isize)).Number;
                        yyMinutes = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yySeconds = 0 as libc::c_int as time_t;
                        yyMeridian = (*yyvsp.offset(0 as libc::c_int as isize)).Meridian;
                    }
                    11 => {
                        yyHour = (*yyvsp.offset(-(3 as libc::c_int) as isize)).Number;
                        yyMinutes = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyMeridian = MER24;
                        yyDSTmode = DSToff;
                        yyTimezone = -((*yyvsp.offset(0 as libc::c_int as isize)).Number
                            % 100 as libc::c_int as libc::c_long
                            + (*yyvsp.offset(0 as libc::c_int as isize)).Number
                                / 100 as libc::c_int as libc::c_long
                                * 60 as libc::c_int as libc::c_long);
                    }
                    12 => {
                        yyHour = (*yyvsp.offset(-(5 as libc::c_int) as isize)).Number;
                        yyMinutes = (*yyvsp.offset(-(3 as libc::c_int) as isize)).Number;
                        yySeconds = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyMeridian = (*yyvsp.offset(0 as libc::c_int as isize)).Meridian;
                    }
                    13 => {
                        yyHour = (*yyvsp.offset(-(5 as libc::c_int) as isize)).Number;
                        yyMinutes = (*yyvsp.offset(-(3 as libc::c_int) as isize)).Number;
                        yySeconds = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyMeridian = MER24;
                        yyDSTmode = DSToff;
                        yyTimezone = -((*yyvsp.offset(0 as libc::c_int as isize)).Number
                            % 100 as libc::c_int as libc::c_long
                            + (*yyvsp.offset(0 as libc::c_int as isize)).Number
                                / 100 as libc::c_int as libc::c_long
                                * 60 as libc::c_int as libc::c_long);
                    }
                    14 => {
                        yyTimezone = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                        yyDSTmode = DSToff;
                    }
                    15 => {
                        yyTimezone = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                        yyDSTmode = DSTon;
                    }
                    16 => {
                        yyTimezone = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyDSTmode = DSTon;
                    }
                    17 => {
                        yyDayOrdinal = 1 as libc::c_int as time_t;
                        yyDayNumber = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    18 => {
                        yyDayOrdinal = 1 as libc::c_int as time_t;
                        yyDayNumber = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                    }
                    19 => {
                        yyDayOrdinal = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyDayNumber = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    20 => {
                        yyMonth = (*yyvsp.offset(-(2 as libc::c_int) as isize)).Number;
                        yyDay = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    21 => {
                        if (*yyvsp.offset(-(4 as libc::c_int) as isize)).Number
                            >= 100 as libc::c_int as libc::c_long
                        {
                            yyYear = (*yyvsp.offset(-(4 as libc::c_int) as isize)).Number;
                            yyMonth = (*yyvsp.offset(-(2 as libc::c_int) as isize)).Number;
                            yyDay = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                        } else {
                            yyMonth = (*yyvsp.offset(-(4 as libc::c_int) as isize)).Number;
                            yyDay = (*yyvsp.offset(-(2 as libc::c_int) as isize)).Number;
                            yyYear = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                        }
                    }
                    22 => {
                        yyYear = (*yyvsp.offset(-(2 as libc::c_int) as isize)).Number;
                        yyMonth = -(*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyDay = -(*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    23 => {
                        yyDay = (*yyvsp.offset(-(2 as libc::c_int) as isize)).Number;
                        yyMonth = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyYear = -(*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    24 => {
                        yyMonth = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyDay = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    25 => {
                        yyMonth = (*yyvsp.offset(-(3 as libc::c_int) as isize)).Number;
                        yyDay = (*yyvsp.offset(-(2 as libc::c_int) as isize)).Number;
                        yyYear = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    26 => {
                        yyMonth = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                        yyDay = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                    }
                    27 => {
                        yyMonth = (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                        yyDay = (*yyvsp.offset(-(2 as libc::c_int) as isize)).Number;
                        yyYear = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    28 => {
                        yyRelSeconds = -yyRelSeconds;
                        yyRelMonth = -yyRelMonth;
                    }
                    30 => {
                        yyRelSeconds += (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number
                            * (*yyvsp.offset(0 as libc::c_int as isize)).Number
                            * 60 as libc::c_long;
                    }
                    31 => {
                        yyRelSeconds += (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number
                            * (*yyvsp.offset(0 as libc::c_int as isize)).Number
                            * 60 as libc::c_long;
                    }
                    32 => {
                        yyRelSeconds +=
                            (*yyvsp.offset(0 as libc::c_int as isize)).Number * 60 as libc::c_long;
                    }
                    33 => {
                        yyRelSeconds += (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                    }
                    34 => {
                        yyRelSeconds += (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number;
                    }
                    35 => {
                        yyRelSeconds += 1;
                    }
                    36 => {
                        yyRelMonth += (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number
                            * (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    37 => {
                        yyRelMonth += (*yyvsp.offset(-(1 as libc::c_int) as isize)).Number
                            * (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    38 => {
                        yyRelMonth += (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                    }
                    39 => {
                        if yyHaveTime != 0 && yyHaveDate != 0 && yyHaveRel == 0 {
                            yyYear = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                        } else if (*yyvsp.offset(0 as libc::c_int as isize)).Number
                            > 10000 as libc::c_int as libc::c_long
                        {
                            yyHaveDate += 1;
                            yyDay = (*yyvsp.offset(0 as libc::c_int as isize)).Number
                                % 100 as libc::c_int as libc::c_long;
                            yyMonth = (*yyvsp.offset(0 as libc::c_int as isize)).Number
                                / 100 as libc::c_int as libc::c_long
                                % 100 as libc::c_int as libc::c_long;
                            yyYear = (*yyvsp.offset(0 as libc::c_int as isize)).Number
                                / 10000 as libc::c_int as libc::c_long;
                        } else {
                            yyHaveTime += 1;
                            if (*yyvsp.offset(0 as libc::c_int as isize)).Number
                                < 100 as libc::c_int as libc::c_long
                            {
                                yyHour = (*yyvsp.offset(0 as libc::c_int as isize)).Number;
                                yyMinutes = 0 as libc::c_int as time_t;
                            } else {
                                yyHour = (*yyvsp.offset(0 as libc::c_int as isize)).Number
                                    / 100 as libc::c_int as libc::c_long;
                                yyMinutes = (*yyvsp.offset(0 as libc::c_int as isize)).Number
                                    % 100 as libc::c_int as libc::c_long;
                            }
                            yySeconds = 0 as libc::c_int as time_t;
                            yyMeridian = MER24;
                        }
                    }
                    40 => {
                        yyval.Meridian = MER24;
                    }
                    41 => {
                        yyval.Meridian = (*yyvsp.offset(0 as libc::c_int as isize)).Meridian;
                    }
                    _ => {}
                }
                yyssp = yyssp.offset(-(yym as isize));
                yystate = *yyssp as libc::c_int;
                yyvsp = yyvsp.offset(-(yym as isize));
                yym = yylhs[yyn as usize] as libc::c_int;
                if yystate == 0 as libc::c_int && yym == 0 as libc::c_int {
                    yystate = 1 as libc::c_int;
                    yyssp = yyssp.offset(1);
                    *yyssp = 1 as libc::c_int as libc::c_short;
                    yyvsp = yyvsp.offset(1);
                    *yyvsp = yyval;
                    if yychar < 0 as libc::c_int {
                        yychar = yylex();
                        if yychar < 0 as libc::c_int {
                            yychar = 0 as libc::c_int;
                        }
                    }
                    if !(yychar == 0 as libc::c_int) {
                        continue;
                    }
                    if !yyss.is_null() {
                        free(yyss as *mut libc::c_void);
                    }
                    if !yyvs.is_null() {
                        free(yyvs as *mut libc::c_void);
                    }
                    yyssp = 0 as *mut libc::c_short;
                    yyss = yyssp;
                    yyvsp = 0 as *mut YYSTYPE;
                    yyvs = yyvsp;
                    yystacksize = 0 as libc::c_int as libc::c_uint;
                    return 0 as libc::c_int;
                } else {
                    yyn = yygindex[yym as usize] as libc::c_int;
                    if yyn != 0
                        && {
                            yyn += yystate;
                            yyn >= 0 as libc::c_int
                        }
                        && yyn <= 337 as libc::c_int
                        && yycheck[yyn as usize] as libc::c_int == yystate
                    {
                        yystate = yytable[yyn as usize] as libc::c_int;
                    } else {
                        yystate = yydgoto[yym as usize] as libc::c_int;
                    }
                    if yyssp >= yysslim && yygrowstack() != 0 {
                        current_block = 5448092431880210809;
                        break;
                    }
                    yyssp = yyssp.offset(1);
                    *yyssp = yystate as libc::c_short;
                    yyvsp = yyvsp.offset(1);
                    *yyvsp = yyval;
                }
            }
        }
        match current_block {
            5448092431880210809 => {
                yyerror(b"yacc stack overflow\0" as *const u8 as *const libc::c_char);
            }
            _ => {}
        }
        if !yyss.is_null() {
            free(yyss as *mut libc::c_void);
        }
        if !yyvs.is_null() {
            free(yyvs as *mut libc::c_void);
        }
        yyssp = 0 as *mut libc::c_short;
        yyss = yyssp;
        yyvsp = 0 as *mut YYSTYPE;
        yyvs = yyvsp;
        yystacksize = 0 as libc::c_int as libc::c_uint;
    } //unsafe
    return 1 as libc::c_int;
}
